home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / xd-2.08 / xd-2 / xd / usr / local / include / ICString.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-14  |  1.0 KB  |  48 lines

  1. /*
  2.                 S t r i n g . h
  3.  
  4. */
  5.  
  6. #ifndef _ICString_H_
  7. #   define _ICString_H_
  8.  
  9. #include <malloc.h>
  10. #include <string.h>
  11.  
  12. class ICString
  13. {
  14.     public:
  15.     ICString(void);            // default constructor
  16.     ~ICString();            // destructor (2)
  17.  
  18.     ICString(const ICString &other);// copy constructor (3)
  19.                     // assign.cc
  20.     ICString const& operator= (const ICString &other);    
  21.  
  22.     unsigned get_count(void) const;    // return # of strings
  23.                     // return string given index
  24.     char const *get_string(unsigned index) const;
  25.     
  26.     void add (char const *str);    // add new string
  27.  
  28.     void remove(int index);        // remove string, given index
  29.                     // note: indexes will change !
  30.  
  31.                     // get index of target (or 0xffff)
  32.     unsigned get_index(char const *target) const;
  33.  
  34.         void setup (unsigned count,     // fill with vector of strings
  35.                     char const* const* vector);
  36.     private:
  37.     void copy(unsigned count, char const* const* vector);
  38.     
  39.     void destroy(void);            // internal destructor
  40.  
  41.     unsigned
  42.         count;            // number of strings in the array
  43.     char
  44.         **vector;        // vector of string pointers
  45. };
  46.  
  47. #endif
  48.